home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 10WS462 (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  2.3 KB  |  54 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.JComboBox;
  4. import com.sun.java.swing.JComponent;
  5. import java.awt.Component;
  6. import java.awt.Container;
  7. import java.awt.Dimension;
  8. import java.awt.Insets;
  9. import java.awt.LayoutManager;
  10. import java.awt.Rectangle;
  11.  
  12. public class BasicComboBoxUI$ComboBoxLayoutManager implements LayoutManager {
  13.    // $FF: synthetic field
  14.    BasicComboBoxUI this$0;
  15.  
  16.    public void addLayoutComponent(String name, Component comp) {
  17.    }
  18.  
  19.    public void removeLayoutComponent(Component comp) {
  20.    }
  21.  
  22.    public Dimension preferredLayoutSize(Container parent) {
  23.       JComboBox var10000 = (JComboBox)parent;
  24.       return parent.getPreferredSize();
  25.    }
  26.  
  27.    public Dimension minimumLayoutSize(Container parent) {
  28.       JComboBox var10000 = (JComboBox)parent;
  29.       return parent.getMinimumSize();
  30.    }
  31.  
  32.    public void layoutContainer(Container parent) {
  33.       JComboBox cb = (JComboBox)parent;
  34.       int width = ((JComponent)cb).getWidth();
  35.       int height = ((JComponent)cb).getHeight();
  36.       Insets insets = this.this$0.getInsets();
  37.       int buttonSize = height - (insets.top + insets.bottom);
  38.       if (this.this$0.editor != null) {
  39.          Rectangle cvb = this.this$0.rectangleForCurrentValue();
  40.          this.this$0.editor.setBounds(cvb);
  41.       }
  42.  
  43.       if (this.this$0.arrowButton != null) {
  44.          this.this$0.arrowButton.setBounds(width - (insets.right + buttonSize), insets.top, buttonSize, buttonSize);
  45.       }
  46.  
  47.    }
  48.  
  49.    // $FF: synthetic method
  50.    public BasicComboBoxUI$ComboBoxLayoutManager(BasicComboBoxUI this$0) {
  51.       this.this$0 = this$0;
  52.    }
  53. }
  54.